package com.example.calculation;
import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import java.util.Map;

public class Query extends AppCompatActivity {
    private TextView tv_show;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_query);
        tv_show = findViewById(R.id.tv_show);
        findViewById(R.id.btn_query).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                DaoImp imp = new DaoImp();
                Map<Integer, String> map = imp.selectAll();
                //遍历map
                map.forEach((id, s) -> {
                    String content = map.get(id);
                    System.out.println(id + "=" + content);
                });
            }
        });
    }
}